import request from '@/utils/request'

// 查询发布领养列表
export function listPromAdoption(query) {
  return request({
    url: '/petSys/promAdoption/list',
    method: 'get',
    params: query
  })
}

// 查询发布领养详细
export function getPromAdoption(id) {
  return request({
    url: '/petSys/promAdoption/' + id,
    method: 'get'
  })
}

// 新增发布领养
export function addPromAdoption(data) {
  return request({
    url: '/petSys/promAdoption',
    method: 'post',
    data: data
  })
}

// 修改发布领养
export function updatePromAdoption(data) {
  return request({
    url: '/petSys/promAdoption',
    method: 'put',
    data: data
  })
}

// 删除发布领养
export function delPromAdoption(id) {
  return request({
    url: '/petSys/promAdoption/' + id,
    method: 'delete'
  })
}


// 领养图片上传
export function adoptionUpload(data) {
  return request({
    url: '/petSys/promAdoption/adoptionUpload',
    method: 'post',
    data: data,
    headers: {
        'Content-Type': 'multipart/form-data'
       }
  })
}

// 获取基础路径
export function getBaseUrl() {
  return request({
    url: '/otherComm/getBaseUrl',
    method: 'get',
  })
}
// 删除文件
export function deleteAdopImg(fileUrl) {
  return request({
    url: '/petSys/promAdoption/deleteAdopImg',
    method: 'post',
    params:{
      fileUrl:fileUrl
    }
  })
}



// 新增申请领养
export function addApplyAdoption(data) {
  return request({
    url: '/petSys/applyAdoption',
    method: 'post',
    data: data
  })
}

